#include "Assert.h"

#include <cstdio>

namespace Rz { namespace Diagnostics {

void __Assert(int expression, const char* filename, int line, const char* fn, const char* expr, const char* msg)
{
	if (!expression)
	{
		char message[1024];

		if (msg)
		{
			sprintf(message, 
				"An exception has occurred!\n\n"
				"%s\n\n"
				"Function: %s\n\n"
				"File: \"%s\"\n\n"
				"Line: %d\n\n"
				"Expr.: (%s) has returned false\n\n",
				msg, fn, filename, line, expr);
		}
		else
		{
			sprintf(message, 
				"An exception has occurred!\n\n"
				"Function: %s\n\n"
				"File: \"%s\"\n\n"
				"Line: %d\n\n"
				"Expr.: (%s) has returned false\n\n",
				fn, filename, line, expr);
		}


	}
}

} }
